package com.csw.monkmanager.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Id;
import java.io.Serializable;
import java.util.Date;

/**
 * @author 1
 */
@NoArgsConstructor
@Accessors(chain = true)
@Data
public class Course implements Serializable {
	@Id
	private String id;// `id` varchar(255) NOT NULL,
	private String title;// `title` varchar(255) DEFAULT NULL,
	private String userId;// `user_id` varchar(255) DEFAULT NULL,
	private String type;// `type` varchar(255) DEFAULT NULL,
	@DateTimeFormat(pattern = "YYYY-MM-dd")
	@JsonFormat(pattern = "YYYY-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createDate;// `create_date` date DEFAULT NULL,

	public Course(String id, String title, String userId, String type, Date createDate) {
		this.id = id;
		this.title = title;
		this.userId = userId;
		this.type = type;
		this.createDate = createDate;
	}
}
